package cn.com.chengmandian.service.erp.constants;

public enum StockPurchaseStatusEnum {

    // 状态，1-草稿 2-审批中 3-审批通过 4-入库完成 5-审批不通过
    BOOK(1,"草稿"),
    AUDIT(2,"审批中"),
    SUCCESS(3,"审批成功"),
    FINISH(4,"入库完成"),
    NOT(5,"审批不通过"),
    DISCARD(6,"废弃");


    private Integer code;
    public Integer getCode(){
        return this.code;
    }

    private String name;
    public String getName(){
        return this.name;
    }

    public static StockPurchaseStatusEnum getByCode(Integer code){
        if(code == null){
            return null;
        }else{
            StockPurchaseStatusEnum[] stockPurchaseStatusEnums = values();
            for (StockPurchaseStatusEnum stockPurchaseStatusEnum : stockPurchaseStatusEnums){
                if(stockPurchaseStatusEnum.getCode().equals(code)){
                    return stockPurchaseStatusEnum;
                }
            }
        }
        return null;
    }

    StockPurchaseStatusEnum(Integer code,String name){
        this.code = code;
        this.name = name;
    }
}
